package no.ntnu.fp.gui.listeners;

import no.ntnu.fp.gui.events.DeleteAppointmentEvent;
import no.ntnu.fp.services.AppointmentService;

public class DeleteAppointmentListener implements GuiListener<DeleteAppointmentEvent> {

	private final AppointmentService appointmentService;
	
	public DeleteAppointmentListener(AppointmentService appointmentService) {
		this.appointmentService = appointmentService;
	}

	@Override
	public void handleEvent(DeleteAppointmentEvent evt) {
		appointmentService.deleteAppointment(evt.getAppointment());
	}

	@Override
	public boolean isLongRunningListener() {
		return false;
	}

}
